import { request, config } from '../utils'
const { api } = config
const { addArticle,updateArticle,pageArticle,topArticle,releaseArticle,offTheShelve,deleteArticle,articleDetail } = api

//????
export async function addArt(params){
    return request({
        url: addArticle,
        method:'POST',
        data:params
    })
}
//????
export async function updateArt(params){
    return request({
        url:updateArticle,
        method:'POST',
        data:params
    })
}
//资讯分页查询
export async function pageArt(params){
    return request({
        url:pageArticle,
        method:'POST',
        data:params
    })
}
//置顶操作
export async function topArt(params){
    return request({
        url:`${topArticle}/${params}`,
        method:'POST',
    })
}

//资讯发布
export async function releaseArt(params) {
    return request({
        url:`${releaseArticle}/${params}`,
        method:'POST',
    })
}

//下架
export async function offShelve(params) {
    return request({
        url:`${offTheShelve}/${params}`,
        method:'POST',
    })
}

//资讯删除
export async function deleteArt(params){
    return request({
        url:`${deleteArticle}/${params}`,
        method:'POST',
    })
}

//资讯详情
export async function artDetail(params){
    return request({
        url:`${articleDetail}/${params}`,
        method:'POST'
    })
}
